<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
         <link href="${pageContext.request.contextPath}/adminfile/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/css/style.css"/>       
        <link href="${pageContext.request.contextPath}/adminfile/assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/assets/css/ace.min.css" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="${pageContext.request.contextPath}/adminfile/js/jquery-1.9.1.min.js"></script>
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/typeahead-bs2.min.js"></script>   
        <script src="${pageContext.request.contextPath}/adminfile/js/lrtk.js" type="text/javascript" ></script>		
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/jquery.dataTables.min.js"></script>
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="${pageContext.request.contextPath}/adminfile/assets/layer/layer.js" type="text/javascript" ></script>                 
<title>艺术品信息管理</title>
</head>

<body>
<div class="page-content clearfix">
 <div class="sort_style">
     <div class="border clearfix">
       <span class="l_f">
        <a href="javascript:ovid()" class="btn btn-danger"><i class="fa fa-trash"></i> 批量删除</a>
       </span>
       <span class="r_f">共：<b>${artList.size()}</b>件</span>
     </div>
  <div class="sort_list">
    <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
				<th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="80px">产品编号</th>
				<th width="200px">产品名称</th>
				<th width="100px">产品类别</th>
				<th width="100px">进价</th>
                <th width="100px">尺寸</th>				
				<th width="80px" style="table-layout: fixed;">介绍</th>
				<th width="200px">时间</th>
                <th width="80px">数量</th>         
				<th width="70px">状态</th>                  
				<th width="220px">操作</th>
			</tr>
		</thead>
	<tbody>
	<c:forEach items="${artList}" var="art">
      <tr>
       <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
       <td>${art.artId}</td>
       <td>${art.artName}</td>
       <td>${art.category.categoryName}</td>
       <td>${art.artCost}</td>
       <td>${art.artSize}</td>
       <td width="80px" style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 15px;table-layout: fixed;color: blue" title="${art.artIntroduce}">详情</td> 
       <td>${art.artAdddate}</td>
       <td>${art.artSum}</td>
       <c:if test="${art.artState==0}">
           <td class="td-status"><span class="label label-defaunt radius">未上架</span></td>
       </c:if>
       <c:if test="${art.artState==1}">
           <td class="td-status"><span class="label label-success radius">已上架</span></td>
       </c:if>
       <td class="td-manage">
       <c:if test="${art.artState==0}">
        <a href="${pageContext.request.contextPath}/Art/getArt?artId=${art.artId}&sign=2" title="上架"  class="btn btn-xs btn-success"><i class="fa fa-check  bigger-120"></i></a>   
       </c:if>
        <a title="编辑" onclick="member_edit('550',this)" href="javascript:;"  class="btn btn-xs btn-info" ><i class="fa fa-edit bigger-120"></i></a>      
        <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="fa fa-trash  bigger-120"></i></a>
       </td>
      </tr>
      </c:forEach>
    </tbody>
    </table>
  </div>
 </div>
</div>
<!--添加图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
  <form action="" method="post" id="form">
  <ul>
  <span class="name"><input type="hidden" id="text0" value="" name="auctionInfoId"></span> 
   <li><label class="label_name">产品名称：</label><span class="name"><input id="text1" value="" name="auctionStartPrice"></span></li>
   <li><label class="label_name">类别：</label><span class="name"><input id="text2" value="" name="auctionLadder"></span></li>
   <li><label class="label_name">进价：</label><span class="name"><input id="text3" type="text" value="" name="auctionOnePrice"></span></li>
   <li><label class="label_name">尺寸：</label><span class="name"><input id="d4311" class="Wdate" type="text"  onClick="WdatePicker({maxDate:'#F{$dp.$D(\'d4312\')||\'2020-10-01\'}',minDate:'%y-%M-{%d+1}',dateFmt:'yyyy-MM-dd 00:00:00'})" name="auctionStartTime" value=""/></span></li>
  </ul> 
  </form>
 </div>
</body>
</html>
<script type="text/javascript">
function member_edit(id,t){
/* 	  $("#text0").val($(t).closest("tr").find("#text_i").text());
	  $("#text1").val($(t).closest("tr").find("#text_s").text());
	  $("#text2").val($(t).closest("tr").find("#text_l").text());
	  $("#text3").val($(t).closest("tr").find("#text_o").text());
	  $("#d4311").val($(t).closest("tr").find("#text_st").text());
	  $("#d4312").val($(t).closest("tr").find("#text_et").text());
	  */ layer.open({
      type: 1,
      title: '修改拍卖信息',
		maxmin: true, 
		shadeClose:false, //点击遮罩关闭层
      area : ['800px' , ''],
      content:$('#add_menber_style'),
		btn:['提交','取消'],
		yes:function(index,layero){	
		 var num=0;
		 var str="";
   $(".add_menber input[type$='text']").each(function(n){
        if($(this).val()=="")
        {
             
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
              title: '提示框',				
				icon:0,								
        }); 
		    num++;
          return false;            
        } 
		 });
		  if(num>0){  return false;}	 	
        else{
      	  $.ajax({
      	         type: "POST",
      	         url: "update",
      	         data: $('#form').serialize(),
      	         success: function (date) {
      	        	if(date=="success")
      	        		{
      	        	 layer.alert('添加成功！',{
      	                 title: '提示框',				
      	  			icon:1,		
      	  			  });
      	        	 
 		/* 	          $(t).closest("tr").find("#text_s").text($("#text1").val());
      	    	  $(t).closest("tr").find("#text_l").text($("#text2").val());
      	    	  $(t).closest("tr").find("#text_o").text($("#text3").val());
      	    	  $(t).closest("tr").find("#text_st").text($("#d4311").val());
      	    	  $(t).closest("tr").find("#text_et").text($("#d4312").val());
      	         */		}	 
      	         }
      	     })

			   layer.close(index);
		  }		  		     				
		}
  });
	  
}
/*广告图片-删除*/
function member_del(obj,id){
	layer.confirm('确认要删除吗？',{icon:0,},function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
//面包屑返回值
var index = parent.layer.getFrameIndex(window.name);
parent.layer.iframeAuto(index);
$('.Order_form ,.ads_link').on('click', function(){
	var cname = $(this).attr("title");
	var cnames = parent.$('.Current_page').html();
	var herf = parent.$("#iframe").attr("src");
    parent.$('#parentIframe span').html(cname);
	parent.$('#parentIframe').css("display","inline-block");
    parent.$('.Current_page').attr("name",herf).css({"color":"#4c8fbd","cursor":"pointer"});
	//parent.$('.Current_page').html("<a href='javascript:void(0)' name="+herf+">" + cnames + "</a>");
    parent.layer.close(index);
	
});
function AdlistOrders(id){
	window.location.href = "Ads_list.html?="+id;
};
</script>
<script type="text/javascript">
jQuery(function($) {
				var oTable1 = $('#sample-table').dataTable( {
				"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,5,6,10]}// 制定列不参与排序
		] } );
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});						
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
</script>